import requests from '@src/common/request'

export function getStoreList() {
  return requests.post({
    url: '/mall/anon/store/list',
    data: {
      storeListQuery: {
        latitude: 0,
        longitude: 0,
        name: "xxx"
      }
    }
  })
}


//获取商品店铺列表
export function addAddress(form) {
  return requests.post({
    url: '/mall/mobile/address/add',
    data: form
  })
}

//拉取商品详情
export function getGoodDetail(data) {
  return requests.get('/mall/anon/goods/detail?goodsSerial=' + data.goodsSerial + '&storeId=' + data.storeId)
}

//拉取券详情信息
// export function getTicketDetail(identityCode) {
//   return request.getRequest
//     ('/memberAdmin/coupon/prototype?id=' + identityCode)
// }
export function getTicketDetail(identityCode) {
  return requests.get('/memberApp/coupon/receivePageInfo?identityCode=' + identityCode)
}

//拉取门店列表
export function getShopList(shopListReq) {
  return requests.post({
    url: '/memberApp/business/shopList',
    data: shopListReq
  })
}

//拉取商品店铺列表
export function getshopListByGood(req) {
  return requests.post({
    url: '/mall/anon/goods/store_list',
    data: req
  })
}

//查询会员信息
export function getMemberInfo() {
  return requests.get('/memberApp/member/info')
}

//分享商品
export function shareGoods(req) {
  return requests.post('/mall/anon/goods/share?goodsId=' + req.goodsId + '&skuId=' + req.skuId + '&storeId=' + req.storeId)
}

//获取商户头像
export function getBusinessInfo() {
  return requests.get('/uaa/wxapp/base/biz_info')
}

//获取商品类目
export function getTree() {
  return requests.get('/mall/anon/goods/tree')
}

//商品搜索

export function goodsQuery(storeId, req) {
  return requests.post({
    url: '/mall/anon/goods/query?storeId=' + storeId,
    data: req
  })
}

//拉取货架目录
export function getShelfGoods(type) {
  return requests.get('/mall/anon/shelf/category/list?type=' + type)
}

//拉取货架商品
export function getGoodsBySelf(storeId, req) {
  return requests.post({
    url: '/mall/anon/goods/shelf?storeId=' + storeId,
    data: req
  })
}

// 拉取扫码点单货架商品
export function getGoodsDot(req) {
  return requests.post({
    url: '/wcanyin/anon/goods/shelf/detail',
    data: req
  })
}



